<!-- MRBR02（团体淘汰赛明细成绩单2节） -->
<template>
  <div>
    <div class="item-info">
      <div
        :class="['single-item', item.flag ? 'active-item' : '']"
        v-for="(item, index) in singleItemList"
        :key="index"
      >
        <div>{{ item.name }}</div>
        <div class="item-logo">
          <img :src="item.logo" alt="" />
        </div>
      </div>
      <div class="single-item-info">
        <div class="info-line1">
          <div>{{ gameTitle }}</div>
          <div class="venue">{{ venueName }}</div>
        </div>
        <div class="info-line2">
          <div class="report-name">成绩公告</div>
          <div>{{ gameTime }}</div>
        </div>
      </div>
    </div>
    <div class="game-info">
      <el-col :span="2">
        <div>{{ tableData.column1 }}</div>
      </el-col>
      <el-col :span="10">
        <div class="game-b" style="margin-left:-10px;color:red">{{ tableData.column2 }}</div>
      </el-col>
      <el-col :span="2">
        <div class="game-vs col-style">{{ tableData.column3 }}</div>
      </el-col>
      <el-col :span="10">
        <div class="game-a">
          {{ tableData.column4 }}
        </div>
      </el-col>
    </div>
    <div class="game-table-data">
      <el-row :gutter="24">
        <el-col :span="2" class="col-style-1">
          <el-table :data="reportData">
            <el-table-column
              prop="Table"
              label="桌号"
              header-align="center"
              align="center"
            ></el-table-column>
          </el-table>
        </el-col>
        <el-col :span="10" class="col-style">
          <el-table :data="reportData" style="width: 100%">
            <el-table-column prop="Team1" label="主队" min-width="180px">
              <template slot-scope="scope">
                <div style="color:rgba(230,24,71,1)">
                  {{ scope.row.Team1 }}
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="Band_score1" label="带分" min-width="60px"> </el-table-column>
            <el-table-column prop="Section_11" label="第1节"> </el-table-column>
            <el-table-column prop="Section_12" label="第2节"> </el-table-column>
            <el-table-column prop="Penalty1" label="罚分" min-width="60px"> </el-table-column>
            <el-table-column prop="Score1" label="总分" min-width="60px"> </el-table-column>
          </el-table>
        </el-col>
        <el-col :span="2" class="col-style">
          <el-table :data="reportData" style="width: 100%" header-align="center">
            <el-table-column prop="" header-align="center">
              <template slot="header" slot-scope="scope">
                <div class="game-vs-logo"></div>
              </template>
            </el-table-column>
          </el-table>
        </el-col>
        <el-col :span="10" class="col-style-2">
          <el-table :data="reportData" style="width: 100%">
            <el-table-column prop="Score2" label="总分"  min-width="60px"> </el-table-column>
            <el-table-column prop="Penalty2" label="罚分" min-width="60px"> </el-table-column>
            <el-table-column prop="Section_22" label="第2节"> </el-table-column>
            <el-table-column prop="Section_21" label="第1节"> </el-table-column>
            <el-table-column prop="Band_score2" label="带分" min-width="60px"> </el-table-column>
            <el-table-column label="客队" min-width="180px">
              <template slot-scope="scope">
                <div style="color:rgba(60,135,247,1)">
                  {{ scope.row.Team2 }}
                </div>
              </template>
            </el-table-column>
          </el-table>
        </el-col>
      </el-row>
    </div>
  </div>
</template>
<script>
import { mapState } from 'vuex'
export default {
  created() {
    this.venueName = this.$route.query.venueName
    this.gameTime = this.$route.query.gameTime
    this.gameTitle = this.$route.query.gameTitle
    this.filePath = this.$route.query.filePath
    this.getReportData()
  },
  props: {},
  data() {
    return {
      tableData: {
        column1: '对阵',
        column2: '主队',
        column3: 'VS',
        column4: '客队'
      },
      filePath: '',
      venueName: '',
      gameTime: '',
      gameTitle: '',
      resultList: [
        {
          Table: 'A1-NS',
          Team1: 'A1-NS',
          Band_score1: 'A1-NS',
          Section_11: 'A1-NS',
          Section_12: 'A1-NS',
          Penalty1: 'A1-NS',
          Score1: 'A1-NS',
          Team2: 'A1-NS',
          Band_score2: 'A1-NS',
          Section_21: 'A1-NS',
          Section_22: 'A1-NS',
          Score2: 'A1-NS',
          Penalty2: 'A1-NS'
        }
      ],
      singleItemList: [
        {
          name: '桥牌',
          logo: require('@/assets/img/daily/BR.png'),
          flag: true
        }
      ]
    }
  },
  watch: {},
  computed: {
    ...mapState({
      reportData: state => state.schedule.reportData
    })
  },
  filters: {},
  components: {},
  methods: {
    getReportData() {
      this.$store
        .dispatch('getReportData', this.filePath + '.txt')
        .then(_ => {})
        .catch(error => {
          console.log(error)
        })
    }
  }
}
</script>
<style scoped lang="scss">
@import '@/assets/scss/item.scss';
</style>
